// pages/mine/index.js
const getUser = require('../common/get-user')
const share = require('../../utils/share.js')

Page({
    data: {
        defaultAvatar: "http://img.zhxcxmall.com/static/default-avatar3.png",
    },

    onLoad: function(options) {
        share(options)
        getApp().station_id = ''
        // getUser(false).then(res => {
        //     this.setData({
        //         user: res
        //     })
        // }).catch(err => {
        //     console.log(err)
        //     this.setData({
        //         noAuth: 1
        //     })
        // })
        this.setData({
            user: wx.getStorageSync('user')
        })
    },
    loadData() {
        getApp().http.get('city/tiny-station/member-time').then(res => {
            this.setData({
                is_vip: res.data.time,
                open: res.data.open
            })
        })
    },

    onShow() {
        this.loadData()
        getApp().http.get("city/member/member-info").then(res => {
            this.setData({
                info: res.data
            })
        })
    },
    onShareAppMessage: function() {
        return app.getShareObj('邀请你来逛逛' + wx.getStorageSync('store'))
    },
})